import React from 'react';
import { Route, Switch } from 'react-router-dom';

// // 引入页面
import Root from '../page/root/index';
// 首页
import Home from '../page/home/index';
// //列表页
import ArticleList from '../page/article_list/index';
import AboutMe from '../page/about_me/index';
import ListPic from '../page/list_pic/index';
import LearnNote from '../page/learn_note/index';
import ArticleDetail from '../page/article_detail/index';
import User from '../page/user/index';
import UserCenter from '../page/user_center/index';
import Search from '../page/search/index';
import PostArticle from '../page/post_article/index';
import NotFound from '../page/404/index';


const Routers = () => (
  <Root>
    <Switch>
      <Route exact path="/" component={Home} />
      <Route path="/article-list/:cate" component={ArticleList} />
      <Route path="/learn-note/:cate" component={LearnNote} />
      <Route path="/about" component={AboutMe} />
      <Route path="/list-pic" component={ListPic} />
      <Route path="/article-detail/:arcId" component={ArticleDetail} />
      <Route path="/user/:type/:redirect?" component={User} />
      <Route path="/post-article/:type?/:arcId?" component={PostArticle} />
      <Route path="/search/:keyword" component={Search} />
      <Route path="/user-center" component={UserCenter} />
      <Route path="*" component={NotFound} />
    </Switch>
  </Root>
)
// const Routers = () => (
//   <Root>
//     <Switch>
//       <Route exact path="/" component={Home} />
//     </Switch>
//   </Root>
// )
export default Routers;
